﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SERS.ExamRoom.Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="../js/jquery.ztree.all-3.4.js" type="text/javascript"></script>
    <script src="../Scripts/jq.Slide.js" type="text/javascript"></script>
    <script src="../Scripts/jq_fn.js" type="text/javascript"></script>
    <script src="../js/ShowDiv.js" type="text/javascript"></script>
    <script src="../js/ExamRoom.js" type="text/javascript"></script>
    <link href="../Styles/main.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/Site.css" rel="stylesheet" type="text/css" />
    <link href="../css/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
		<!--
        var setting = {
            view: {
                showLine: false,
                showIcon: false,
                selectedMulti: false,
                dblClickExpand: false,
                addDiyDom: addDiyDom
            },
            data: {
                simpleData: {
                    enable: true
                }
            },
            callback: {
                onRightClick: OnRightClick,
                beforeClick: beforeClick,
                onClick: onClick
            }
        };


        var zNodes = [
			{ id: 1, pId: 0, name: "课程1", open: true, noR: true },
			{ id: 11, pId: 1, name: "模拟考场", open: true },
			{ id: 12, pId: 1, name: "真题练习", open: true, noR: true },
			{ id: 121, pId: 12, name: "2009年真题练习", noR: true },
			{ id: 122, pId: 12, name: "2010年真题练习", noR: true },
			{ id: 123, pId: 12, name: "2011年真题练习", noR: true },
            { id: 124, pId: 12, name: "2012年真题练习", noR: true },
			{ id: 2, pId: 0, name: "课程2", noR: true },
			{ id: 3, pId: 0, name: "课程3", noR: true }
		];

        function addDiyDom(treeId, treeNode) {
            var spaceWidth = 5;
            var switchObj = $("#" + treeNode.tId + "_switch"),
			icoObj = $("#" + treeNode.tId + "_ico");
            switchObj.remove();
            icoObj.before(switchObj);

            if (treeNode.level > 1) {
                var spaceStr = "<span style='display: inline-block;width:" + (spaceWidth * treeNode.level) + "px'></span>";
                switchObj.before(spaceStr);
            }
        }

        function getTime() {
            var now = new Date(),
			h = now.getHours(),
			m = now.getMinutes(),
			s = now.getSeconds();
            return (h + ":" + m + ":" + s);
        }

        function beforeClick(treeId, treeNode) {
            if (treeNode.level == 0) {
                var zTree = $.fn.zTree.getZTreeObj("treeDemo");
                zTree.expandNode(treeNode);
                return false;
            }
            return true;
        }

        function onClick(event, treeId, treeNode, clickFlag) {
            var nodeName = treeNode.name;
            if (nodeName == "2009年真题练习") {
                GetNewExam(2009, 1);
            }
            else if (nodeName == "2010年真题练习") {
                GetNewExam(2010, 1);
            }
            else if (nodeName == "2011年真题练习") {
                GetNewExam(2011, 1);
            }
            else if (nodeName == "2012年真题练习") {
                GetNewExam(2012, 1);
            }
            else if (nodeName.indexOf("模拟题") >= 0) {
                var id = nodeName.replace("模拟题", "");
                GetNewExam(id, 1);
            }
        }

        function OnRightClick(event, treeId, treeNode) {
            var nodeName = treeNode.name;
            if (!treeNode && event.target.tagName.toLowerCase() != "button" && $(event.target).parents("a").length == 0) {
                zTree.cancelSelectedNode();

                if (nodeName == "模拟考场") {
                    showRMenu("root", event.clientX, event.clientY);
                }
            } else if (treeNode && !treeNode.noR) {
                zTree.selectNode(treeNode);
                if (nodeName == "模拟考场") {
                    showRMenu("root", event.clientX, event.clientY);
                }
                else {
                    showRMenu("node", event.clientX, event.clientY);
                }
            }
        }

        function showRMenu(type, x, y) {
            $("#rMenu ul").show();
            if (type == "root") {
                $("#m_del").hide();
                $("#m_add").show();
            } else {
                $("#m_del").show();
                $("#m_add").hide();
            }
            rMenu.css({ "top": y + "px", "left": x + "px", "visibility": "visible" });

            $("body").bind("mousedown", onBodyMouseDown);
        }
        function hideRMenu() {
            if (rMenu) rMenu.css({ "visibility": "hidden" });
            $("body").unbind("mousedown", onBodyMouseDown);
        }
        function onBodyMouseDown(event) {
            if (!(event.target.id == "rMenu" || $(event.target).parents("#rMenu").length > 0)) {
                rMenu.css({ "visibility": "hidden" });
            }
        }
        var addCount = 2;
        function addTreeNode() {
            hideRMenu();
            if (addCount == 2) {
                addCount = parseInt($("#hidExamMaxId").val());
                addCount++;
            }
            GetNewExam(addCount, 1);
            var newNode = { name: "模拟题" + (addCount++) };
            if (zTree.getSelectedNodes()[0]) {
                newNode.checked = zTree.getSelectedNodes()[0].checked;
                zTree.addNodes(zTree.getSelectedNodes()[0], newNode);
            } else {
                zTree.addNodes(null, newNode);
            }
        }
        function removeTreeNode() {
            var nodes = zTree.getSelectedNodes();
            if (nodes && nodes.length > 0) {
                var nodeName = nodes[0].name;
                if (nodeName.indexOf("模拟题") >= 0) {
                    var id = nodeName.replace("模拟题", "");
                    DelNewExam(id);
                }
            }
        }
        function checkTreeNode(checked) {
            var nodes = zTree.getSelectedNodes();
            if (nodes && nodes.length > 0) {
                zTree.checkNode(nodes[0], checked, true);
            }
            hideRMenu();
        }
        function resetTree() {
            hideRMenu();
            $.fn.zTree.init($("#treeDemo"), setting, zNodes);
        }

        var curMenu = null, zTree, rMenu;
        $(document).ready(function () {
            var treeObj = $("#treeDemo");
            $.fn.zTree.init(treeObj, setting, zNodes);
            zTree = $.fn.zTree.getZTreeObj("treeDemo");
            rMenu = $("#rMenu");

            curMenu = zTree.getNodes()[0].children[0];
            zTree.selectNode(curMenu);

            treeObj.hover(function () {
                if (!treeObj.hasClass("showIcon")) {
                    treeObj.addClass("showIcon");
                }
            }, function () {
                treeObj.removeClass("showIcon");
            });
            GetZNodes();
        });

        //加载菜单
        function GetZNodes() {
            var examId = $("#hidExamIdList").val();
            if (examId != null && examId != "") {
                var examIdList = examId.split('|');
                for (var i = 0; i < examIdList.length; i++) {
                    if (examIdList[i] != null && examIdList[i] != "") {
                        addExams(examIdList[i]);
                    }
                }
                GetNewExam(examIdList[0], 1);
            }
            else {
                addExams(1);
                GetNewExam(1, 1);
            }
            curMenu = zTree.getNodes()[0].children[0].children[0];
            zTree.selectNode(curMenu);
        }

        //添加菜单
        function addExams(id) {
            hideRMenu();
            var newNode = { name: "模拟题" + (id++) };
            if (zTree.getSelectedNodes()[0]) {
                newNode.checked = zTree.getSelectedNodes()[0].checked;
                zTree.addNodes(zTree.getSelectedNodes()[0], newNode);
            } else {
                zTree.addNodes(null, newNode);
            }
        }


		//-->
    </script>
    <style type="text/css">
        .left
        {
            float: left;
            width: 20%;
            height: 458px;
            overflow: hidden;
        }
        
        .right
        {
            float: left;
            width: 80%;
            height: 458px;
            overflow: hidden;
        }
        div#rMenu
        {
            position: absolute;
            visibility: hidden;
            top: 0;
            background-color: #555;
            text-align: left;
            padding: 2px;
        }
        div#rMenu ul
        {
            margin:0;
            padding:0;
        }
        div#rMenu ul li
        {
            margin: 1px 0;
            padding: 0 5px;
            cursor: pointer;
            list-style: none outside none;
            background-color: #DFDFDF;
        }
        
        .noteHeader
        {
            height : 55px;
            width: 100%;
        }
        
        .noteBody
        {
            width: 100%;
            height:200px;
        }
        
        .noteNum table
        {
            border:0px;
            height:80px;
            line-height:18px;
            padding-right: 5px;
            
        }
         .noteNum table td
        {
            height:18px;
        }
         .noteFooder
         {
             height: 50px;
         }
        
        
        
.ztree * {font-size: 10pt;font-family:"Microsoft Yahei",Verdana,Simsun,"Segoe UI Web Light","Segoe UI Light","Segoe UI Web Regular","Segoe UI","Segoe UI Symbol","Helvetica Neue",Arial}
.ztree li ul{ margin:0; padding:0}
.ztree li {line-height:30px;}
.ztree li a {width:200px;height:30px;padding-top: 0px;}
.ztree li a:hover {text-decoration:none; background-color: #E7E7E7;}
.ztree li a span.button.switch {visibility:hidden}
.ztree.showIcon li a span.button.switch {visibility:visible}
.ztree li a.curSelectedNode {background-color:#D4D4D4;border:0;height:30px;}
.ztree li span {line-height:30px;}
.ztree li span.button {margin-top: -7px;}
.ztree li span.button.switch {width: 16px;height: 16px;}

.ztree li a.level0 span {font-size: 150%;font-weight: bold;}
.ztree li span.button {background-image:url(""); *background-image:url("")}
.ztree li span.button.switch.level0 {width: 20px; height:20px}
.ztree li span.button.switch.level1 {width: 20px; height:20px}
.ztree li span.button.noline_open {background-position: 0 0;}
.ztree li span.button.noline_close {background-position: -18px 0;}
.ztree li span.button.noline_open.level0 {background-position: 0 -18px;}
.ztree li span.button.noline_close.level0 {background-position: -18px -18px;}
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:HiddenField ID="hidExams" runat="server" Value="" />
    <!--当前题库ID-->
    <asp:HiddenField ID="hidExamRoomID" runat="server" Value="1" />
    <!--当前题ID-->
    <asp:HiddenField ID="hidQuestionID" runat="server" Value="1" />
    <!--所有模拟题库ID-->
    <asp:HiddenField ID="hidExamIdList" runat="server" Value="1" />
    <!--模拟题库最大ID-->
    <asp:HiddenField ID="hidExamMaxId" runat="server" Value="1" />
    <!--是否收藏-->
    <asp:HiddenField ID="hidFavorite" runat="server" Value="0" />
    <!--是否自动答题-->
    <asp:HiddenField ID="hidAutoAnswer" runat="server" Value="0" />
    <div class="dp_m">
        <div class="dp_top">
        </div>
        <div class="cnt">
            <div class="topbar">
                <div class="logo">
                </div>
                <div class="navi">
                    <div class="nitem1">
                        <a href="#">&nbsp;</a></div>
                    <div class="nitem2 naover2">
                        <a href="#">&nbsp;</a></div>
                    <div class="nitem3">
                        <a href="#">&nbsp;</a></div>
                    <div class="nitem4">
                        <a href="#">&nbsp;</a></div>
                    <div class="nitem5">
                        <a href="#">&nbsp;</a></div>
                </div>
                <div class="close">
                </div>
            </div>
            <div class="mbody31_2">
                <div class="left">
                    <ul id="treeDemo" class="ztree">
                    </ul>
                </div>
                <div class="right" id="log">
                    <div class="noteHeader">
                        <div style="float: left; margin-left: 150px; background-image: url(../images/Clock.JPG);
                            width: 73px; height: 56px">
                        </div>
                        <div style="float: left; margin-left: 50px; background-image: url(../images/favorite.JPG);
                            width: 24px; height: 26px">
                        </div>
                        <div style="float: left; margin-left: 10px; background-image: url(../images/Unfavorite.JPG);
                            width: 27px; height: 26px">
                        </div>
                        <div style="float: right; margin-right: 20px; background-image: url(../images/Note.JPG);
                            width: 131px; height: 37px; cursor: pointer;" onclick="CloseContentDiv(1);">
                        </div>
                    </div>
                    <div class="noteBody" id="question">
                        <ul style="list-style-type: none; padding: 0px;">
                            <li>第1题 单项选择题(单选)(本题1分) </li>
                            <li>
                                <div style="float: left; width: 24px; height: 26px; background-image: url(../images/favorite.JPG);
                                    display: none">
                                </div>
                                关于推选性标准，下列说法正确的是() </li>
                            <li>A. 不管是在什么级别的推荐性标准，都可以不执行</li>
                            <li>B. 如果是推荐性地方标准，也必须执行</li>
                            <li>C. 如果是推荐性行业标准，也必须执行</li>
                            <li>D. 如果是推荐性国家标准，也必须执行</li>
                            <li>
                                <div style="float: left; width: 42px; height: 21px; background-image: url(../images/optionButtonA.JPG)">
                                </div>
                                <div style="float: left; width: 42px; height: 21px; background-image: url(../images/optionButtonB.JPG)">
                                </div>
                                <div style="float: left; width: 42px; height: 21px; background-image: url(../images/optionButtonC.JPG)">
                                </div>
                                <div style="float: left; width: 42px; height: 21px; background-image: url(../images/optionButtonD.JPG)">
                                </div>
                            </li>
                        </ul>
                    </div>
                    <div class="noteNum" id="titleNumber">
                        <table>
                            <tr>
                                <td colspan="25">
                                    当前第 1 题/已答 0 题/共计 100 题 时间:0:00
                                    <input type="button" value="上一题(-)" style="font-size: 11px; width: 60px;" /><input
                                        type="button" value="下一题(+)" style="font-size: 11px; width: 60px;" /><input type="checkbox" id="cbAuto" />自动进入下一题<input
                                            type="button" value="交卷" style="font-size: 11px; width: 60px;" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="20">
                                    未答 选中 已答
                                </td>
                                <td colspan="5">
                                    查看快捷键说明
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    1
                                </td>
                                <td>
                                    2
                                </td>
                                <td>
                                    3
                                </td>
                                <td>
                                    4
                                </td>
                                <td>
                                    5
                                </td>
                                <td>
                                    6
                                </td>
                                <td>
                                    7
                                </td>
                                <td>
                                    8
                                </td>
                                <td>
                                    9
                                </td>
                                <td>
                                    10
                                </td>
                                <td>
                                    11
                                </td>
                                <td>
                                    12
                                </td>
                                <td>
                                    13
                                </td>
                                <td>
                                    14
                                </td>
                                <td>
                                    15
                                </td>
                                <td>
                                    16
                                </td>
                                <td>
                                    17
                                </td>
                                <td>
                                    18
                                </td>
                                <td>
                                    19
                                </td>
                                <td>
                                    20
                                </td>
                                <td>
                                    21
                                </td>
                                <td>
                                    22
                                </td>
                                <td>
                                    23
                                </td>
                                <td>
                                    24
                                </td>
                                <td>
                                    25
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    26
                                </td>
                                <td>
                                    27
                                </td>
                                <td>
                                    28
                                </td>
                                <td>
                                    4
                                </td>
                                <td>
                                    5
                                </td>
                                <td>
                                    6
                                </td>
                                <td>
                                    7
                                </td>
                                <td>
                                    8
                                </td>
                                <td>
                                    9
                                </td>
                                <td>
                                    10
                                </td>
                                <td>
                                    11
                                </td>
                                <td>
                                    12
                                </td>
                                <td>
                                    13
                                </td>
                                <td>
                                    14
                                </td>
                                <td>
                                    15
                                </td>
                                <td>
                                    16
                                </td>
                                <td>
                                    17
                                </td>
                                <td>
                                    18
                                </td>
                                <td>
                                    19
                                </td>
                                <td>
                                    20
                                </td>
                                <td>
                                    21
                                </td>
                                <td>
                                    22
                                </td>
                                <td>
                                    23
                                </td>
                                <td>
                                    24
                                </td>
                                <td>
                                    25
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    1
                                </td>
                                <td>
                                    2
                                </td>
                                <td>
                                    3
                                </td>
                                <td>
                                    4
                                </td>
                                <td>
                                    5
                                </td>
                                <td>
                                    6
                                </td>
                                <td>
                                    7
                                </td>
                                <td>
                                    8
                                </td>
                                <td>
                                    9
                                </td>
                                <td>
                                    10
                                </td>
                                <td>
                                    11
                                </td>
                                <td>
                                    12
                                </td>
                                <td>
                                    13
                                </td>
                                <td>
                                    14
                                </td>
                                <td>
                                    15
                                </td>
                                <td>
                                    16
                                </td>
                                <td>
                                    17
                                </td>
                                <td>
                                    18
                                </td>
                                <td>
                                    19
                                </td>
                                <td>
                                    20
                                </td>
                                <td>
                                    21
                                </td>
                                <td>
                                    22
                                </td>
                                <td>
                                    23
                                </td>
                                <td>
                                    24
                                </td>
                                <td>
                                    25
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    1
                                </td>
                                <td>
                                    2
                                </td>
                                <td>
                                    3
                                </td>
                                <td>
                                    4
                                </td>
                                <td>
                                    5
                                </td>
                                <td>
                                    6
                                </td>
                                <td>
                                    7
                                </td>
                                <td>
                                    8
                                </td>
                                <td>
                                    9
                                </td>
                                <td>
                                    10
                                </td>
                                <td>
                                    11
                                </td>
                                <td>
                                    12
                                </td>
                                <td>
                                    13
                                </td>
                                <td>
                                    14
                                </td>
                                <td>
                                    15
                                </td>
                                <td>
                                    16
                                </td>
                                <td>
                                    17
                                </td>
                                <td>
                                    18
                                </td>
                                <td>
                                    19
                                </td>
                                <td>
                                    20
                                </td>
                                <td>
                                    21
                                </td>
                                <td>
                                    22
                                </td>
                                <td>
                                    23
                                </td>
                                <td>
                                    24
                                </td>
                                <td>
                                    25
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="noteFooder">
                        <div style="float: left; margin-left: 20px; background-image: url(../images/findTitle.JPG);
                            width: 90px; height: 32px; cursor: pointer;" onclick="CloseContentDiv(3);">
                        </div>
                        <div style="float: left; margin-left: 280px; background-image: url(../images/favoriteButton.JPG);
                            width: 87px; height: 30px; cursor: pointer;" onclick="Favorite();">
                        </div>
                        <div style="float: right; margin-right: 20px; background-image: url(../images/errorFeedback.JPG);
                            width: 85px; height: 29px; cursor: pointer;" onclick="CloseContentDiv(2);">
                        </div>
                        <div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="dp_bottom">
            <img src="../images/dpm_bg4.gif" width="794" height="9" /></div>
    </div>
    <div id="rMenu">
        <ul>
            <li id="m_add" onclick="addTreeNode();">增加考题</li>
            <li id="m_del" onclick="removeTreeNode();">清空考题</li>
        </ul>
    </div>
    <div class="login_panel alert_info contentDiv" style="display: none;">
        <div class="panel_title">
            <a href="javascript:void(0);" class="panel_close" onclick="CloseContentDiv();">close</a></div>
        <div class="panel_content">
            <table width="100%" border="0" cellspacing="8" cellpadding="0" style="text-align: center;">
                <tr>
                    <td>
                        <asp:TextBox ID="txtNote" runat="server" TextMode="MultiLine" Style="width: 250px;
                            height: 100px;"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="control submit">
                            <a href="javascript:void(0);" onclick="SaveNote();">保存</a></div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="login_panel alert_info contentDiv" style="display: none;">
        <div class="panel_title">
            <a href="javascript:void(0);" class="panel_close" onclick="CloseContentDiv();">close</a></div>
        <div class="panel_content">
            <table width="100%" border="0" cellspacing="8" cellpadding="0" style="text-align: center;">
                <tr>
                    <td>
                        <asp:TextBox ID="txtError" runat="server" TextMode="MultiLine" Style="width: 250px;
                            height: 100px;"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="control submit">
                            <a href="javascript:void(0);" onclick="SaveError();">保存</a></div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="login_panel alert_info contentDiv" style="display: none;">
        <div class="panel_title">
            <a href="javascript:void(0);" class="panel_close" onclick="CloseContentDiv();">close</a></div>
        <div class="panel_content">
            <table width="100%" border="0" cellspacing="8" cellpadding="0" style="text-align: center;">
                <tr>
                    <td>
                        <input type="text" id="txtSearch" style="width: 200px;" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="control submit">
                            <a href="javascript:void(0);" onclick="Search();">查找</a></div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div id="fullscreem" style="display: none; background-color: #F1F1F1; filter: alpha(opacity=50);
        opacity: 0.5; width: 100%; height: auto; position: absolute; top: 0px; left: 0px;
        z-index: 5;">
    </div>
    </form>
</body>
</html>
